﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XProject.DataVisit.Factory;
using System.Web;

namespace XProject.DataVisit.Handler.View.BaseManager
{
    public class UserInfoView:AbstractView
    {
        public void Login()
        {
            var username = JsonRequest.GetParam<string>("UserAccount");
            var pass = JsonRequest.GetParam<string>("Pass");
            var currentuser = DaoFactory.UserInfoDao.GetByNameAndPass(username, pass);
            if (currentuser != null)
            {
                HttpContext.Current.Session["UserInfo"] = currentuser;
            }
            JsonResponse.ResponseObject = currentuser;
        }
    }
}
